<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Real Property and Business Permit</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen" />
</head>
<body>
<div id="bg">
<div id="logo">
<img src="images/logo_and_name.png" alt="" width="305" height="78" />
</div>
<div id="main">
<div id="out"><h3><p align="right"><a href="admin.php">Home</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">Account</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">logout</a></p></h3></div>
<!-- header begins -->
<div id="header">	
	
	<div id="slider-wrapper">        
					             <div id="slider" class="nivoSlider">
									<img src="images/header.jpg" alt="" title="" />
									<img src="images/header2.jpg" alt="" title="" />
									<img src="images/header3.jpg" alt="" title="" />
									<img src="images/header4.jpg" alt="" title="" />								
                                   	
		</div>        
      </div>
								
<script type="text/javascript" src="lib/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="lib/jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    $(window).load(function() {
        $('#slider').nivoSlider();
    });
    </script>
	
</div>
        <div id="buttons">
		<ul>
			<li class="first"><a href="admin.php"  title="">Home</a></li>
			<li><a href="listofbusinessApp.php" title="">Business Permit</a></li>
			<li><a href="real_property.php" title="">Real Property</a></li>
			<li><a href="#" title="">About</a></li>
			<li><a href="#" title="">Contact</a></li>
		</ul></div>
<!-- header ends -->
<!-- content begins -->
<div id="content_bg">
<center>
    
    <center><h2>Generate Business ID No</h2></center>
  
    <?php
		$x=$_GET['BID']; 
		$db_name = "thesis_bis";
	$table_name = "business";

	$user = "root";
	$pass = "";
	
	$connection = mysql_connect("localhost","$user","$pass")
	or die(mysql_error());

	$db = mysql_select_db($db_name, $connection) or die(mysql_error());

	$sql = "SELECT * FROM $table_name where BID = '$x' ";

	$result = mysql_query($sql, $connection) or die(mysql_error());

	$num= mysql_num_rows($result);
   
    if($num<1)
	{
		$display_block = "<p><em>Empty...</em> </p>";
	}
	else
	{
	$number=0;
	while ($row = mysql_fetch_array($result))

	{   
	 
		$number++;
		$BID=$row['BID'];
		$TPID = $row['TPID'];
		
		
    }
	}
    ?>
   
  
  <table background="images/scroll3.jpg" width="428" border="0">
        <form name="form2" method="post" action="">
       <tr><td>
        
        </td>
        <td>
        <font color="#000000"><strong>Current Information</strong></font></td>
        <td>
        <font color="#000000"><strong>Enter New Information</strong></font></td>
        </tr>
          
           <tr>
            <td width="78">Business ID No:</td>
            <td width="141">
              <font color="#00CCCC" size="3"><strong><?php echo $BID; ?></strong></font></td>
            <td width="195">
              <label>
                <input type="text" name="BID" id="textfield" value="">
                </label></td>
          </tr>
          
          <tr>
          <td>&nbsp;</td>
              <td>&nbsp;</td>
           
            <td><label>        
            <input name="btn_submit2" type="submit" class="icon" id="button" onClick="return validate()" value="Submit">
            </label></td>
          </tr>  
          </form>  
      </table>
      
      <?php
		
		if(isset($_POST['btn_submit2']))
		   {

	
	$db_name = "thesis_bis";
	$table_name = "business";
	$user = "root";
	$pass = "";
	$connection = mysql_connect("localhost","$user","$pass")
	or die(mysql_error());
	$db = mysql_select_db($db_name, $connection) or die(mysql_error());
	
	$sql = "UPDATE $table_name SET BID = '$_POST[BID]'WHERE BID = '$_POST[BID]'";
	
	$result = mysql_query($sql, $connection) or die(mysql_error());
	echo "Business ID Number SUCCESSFULLY UPDATED!";
	
}
?>

</center>
  
  
  
 

</div>
<!-- content ends -->
<!-- footer begins -->
<div id="footer">
   <a href="http://validator.w3.org/check?uri=referer">Copyrights © 2012</a> | <a href="http://guinobatan.gov.ph/index.php/guinobatan/index">Municipality of Guinobatan</a>. | All rights reserved. 
      </p></div>
<!-- footer ends -->
</div>
</div>
</body>
</html>